package nc.ui.zujin.wzdb;
import java.awt.Container;
import java.util.ArrayList;
import java.util.List;

import nc.ui.pub.beans.UIPanel;
import nc.ui.trade.query.HYQueryDLG;
import nc.vo.lm.pub.LmPubTool;
import nc.vo.pub.query.ConditionVO;
/**
 * @author yf
 */
public class ClientUIQueryDlg extends HYQueryDLG {

	public ClientUIQueryDlg(Container parent, UIPanel normalPnl,
			String pk_corp, String moduleCode, String operator,
			String busiType, String nodeKey) {
		super(parent, normalPnl, pk_corp, moduleCode, operator, busiType, nodeKey);
	}

	/**
	 * 
	 */
	private static final long serialVersionUID = 5501803825243796705L;

	public void initData(String pkCorp, String operator, String funNode,
			String businessType, String currentBillType, String sourceBilltype,
			String nodeKey, Object userObj) throws Exception {
		
	}
	
	public String getWhereSQL() {

		String strWhere = null;
		ConditionVO[] cons = getConditionVO();
		List<ConditionVO> lcon = new ArrayList<ConditionVO>();
		for(ConditionVO con:cons){
			if(con.getFieldCode().equalsIgnoreCase("vbillstatus")){
				if(LmPubTool.getIPlanBilltypeBySBilltype(con.getValue())==-1)
					continue;
				con.setValue(String.valueOf(LmPubTool.getIPlanBilltypeBySBilltype(con.getValue())));
			}
			lcon.add(con);
		}	
		cons = lcon.toArray(new ConditionVO[0]);		
		strWhere = getWhereSQL(cons);
		return strWhere;
	}
	
}
